#ifndef _INC_DAY_TIME_T_H_
#define _INC_DAY_TIME_T_H_

#include <iostream>
#include <string>

class DayTime_t
{
public:
	/**
	* Day enumeration
	*/
	enum Day_t
	{
		Undefined = 0,
		Sunday,
		Monday,
		Tuesday,
		Wednesday,
		Thursday,
		Friday,
		Saturday
	};

	static const DayTime_t& invalid; // Invalid type

	/**
	* Default ctor
	*/
	DayTime_t();

	/**
	* Ctor
	*/
	DayTime_t(Day_t day, size_t hours, size_t minutes);

	/**
	* Dtor
	*/
	virtual ~DayTime_t();

	/**
	* Copy Ctor
	*/
	DayTime_t(const DayTime_t& other);

	/**
	* Operator=
	*/
	DayTime_t& operator=(const DayTime_t& other);

	/**
	* Operator==
	*/
	bool operator==(const DayTime_t& other) const;

	/**
	* Operator!=
	*/
	bool operator!=(const DayTime_t& other) const;

	/**
	* Operator<=
	*/
	bool operator<=(const DayTime_t& other) const;

	/**
	* Operator<
	*/
	bool operator<(const DayTime_t& other) const;

	/**
	* Operator+ (day is ignored)
	*/
	DayTime_t operator+(const DayTime_t& other) const;

	/**
	* Operator- (day is ignored)
	*/
	DayTime_t operator-(const DayTime_t& other) const;

	/**
	* Returns day
	*/
	inline Day_t day() const {
		return m_day;
	}

	/**
	* Sets day
	*/
	inline bool setDay(Day_t day) {
		if(day == DayTime_t::Undefined)
			return false;

		m_day = day;
		return true;
	}

	/**
	* Returns hours
	*/
	inline size_t hours() const {
		return m_hours;
	}

	/**
	* Sets hours
	*/
	inline bool setHours(size_t hours) {
		if(hours < 0 || hours > 23)
			return false;

		m_hours = hours;
		return true;
	}

	/**
	* Returns minutes
	*/
	inline size_t minutes() const {
		return m_minutes;
	}

	/**
	* Sets minutes
	*/
	inline bool setMinutes(size_t minutes) {
		if(minutes < 0 || minutes > 59)
			return false;

		m_minutes = minutes;
		return true;
	}

private:
	Day_t m_day; // Day
	size_t m_hours; // Hours
	size_t m_minutes; // Minutes

	/**
	* Operator<<
	*/
	friend std::ostream& operator<<(std::ostream& os, const DayTime_t& other);
};

#endif // _INC_DAY_TIME_T_H_